package com.sugon.entity.dto;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * APP首页菜单Card DTO
 *
 * @author YuXD
 * @since 2021-11-19
 */
@NoArgsConstructor
@Data
public class AppIndexMenuGridDTO implements Serializable {

    private String title;

    private List<AppIndexMenuGridItemDTO> gridItems;

    public AppIndexMenuGridDTO(String title) {
        this.title = title;
        this.gridItems = new ArrayList<>();
    }

    public void addItem(AppIndexMenuGridItemDTO gridItem) {
        if (this.gridItems == null) {
            this.gridItems = new ArrayList<>();
        }
        this.gridItems.add(gridItem);
    }
}
